<template>
	<div class="container">
		<el-breadcrumb separator-class="el-icon-arrow-right">
			<el-breadcrumb-item :to="{ path: '/Main' }"><b>首页</b></el-breadcrumb-item>
			<el-breadcrumb-item :to="{ path: '/Main/ThotelTopic' }">客户开发计划</el-breadcrumb-item>
			<el-breadcrumb-item><b>修改</b></el-breadcrumb-item>
		</el-breadcrumb>

		<el-form :model="ff" :rules="rules" ref="ff" label-width="100px" class="demo-ruleForm" style="margin-top: 15px;"
		 :inline=true>
			<el-form-item label="编号" prop="id" style="width: 500px;">
				<el-input v-model="ff.id" style="width: 300px;" readonly="readonly"></el-input>
			</el-form-item>
			
			<el-form-item label="名称" prop="name" style="width: 500px;">
				<el-input v-model="ff.name" style="width: 300px;"></el-input>
			</el-form-item>
			
			
			
		
			<el-form-item style="width: 700px;margin-left: 300px;">
				<el-button type="primary" @click="save()">确认</el-button>
				<el-button @click="resetForm('ff')" style="margin-left: 100px;margin-top: 20px;">重置</el-button>
			</el-form-item>
		</el-form>


	</div>
</template>

<script>
	export default {
		data() {
			
			return {
				
				
					
				
				ff: {
					id: '',

					name: '',
					

				},

				rules: {
					name: [{
						required: true,
						message: '请输入主题名称名称',
						trigger: 'blur'
					}, ],
				}
			};
		},
		methods: {
			
			bbb: function() {
				this.$router.push('/SalPlanResult');
			},
			save: function() {
				this.$refs['ff'].validate((valid) => {
					if (valid) {
						//获取请求URL
						let url = this.axios.urls.SYS_SB_EDIT;
						console.log(this.ff);
						//发送ajax请求
						this.axios.post(url, this.ff).then(resp => {
							let data = resp.data;
							this.$message({
								message: '修改成功',
								type: 'success'
							});
			
			
							this.$router.replace('/Main/ThotelTopic');
						}).catch(err => {
							console.log(err);
						})
					} else {
						return false;
					}
				});
			},
			resetForm(formName) {
					this.$refs[formName].resetFields();
				}
			},
			
			
		created: function() {
			const data = this.$store.getters.getid;
		
			this.ff.id = data.id;
			
			this.ff.name = data.name;
			
			
			// this.ff.type = data.type;
			// this.ff.icon = data.icon;
			
			// // if (data.chcStatus == '1') {
			// // 	data.chcStatus = '2';
			// // }
			// // this.ff.chcStatus = data.chcStatus;
		}
	}
</script>

<style>
	.container {
		margin: 15px;
	}
</style>
